using System;
using System.Data.Entity.ModelConfiguration;
using System.Data.Common;
using System.Data.Entity;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using HISModels.Entities;

namespace HISModels.Mapping
{
	public class MemberApplicationMap : EntityTypeConfiguration<MemberApplication>
	{
		public MemberApplicationMap()
		{
			// Primary Key
			this.HasKey(t => t.Id);

			// Properties
			this.Property(t => t.ApiKey)
				.HasMaxLength(100);
				
			this.Property(t => t.RefCode)
				.HasMaxLength(20);
				
			// Table & Column Mappings
			this.ToTable("MemberApplications");
			this.Property(t => t.Id).HasColumnName("Id");
			this.Property(t => t.ApiKey).HasColumnName("ApiKey");
			this.Property(t => t.RefCode).HasColumnName("RefCode");
			this.Property(t => t.ValidUntil).HasColumnName("ValidUntil");
			this.Property(t => t.ValidFrom).HasColumnName("ValidFrom");
		}
	}
}

